// @Author EthanScriptOn
// @Desc
package extend_config

import (
	"gitee.com/fatzeng/srf_switch_stream_bridge/framework/operator"
	"github.com/apache/rocketmq-client-go/v2/consumer"
	"github.com/streadway/amqp"
	"time"
)

type LocalWriteOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	FilePath string
	IsAppend bool
}

func (l *LocalWriteOperatorConfig) IsValid() bool {
	return l.FilePath != ""
}

type LocalReadOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	FilePath      string
	SleepDuration time.Duration
}

func (l *LocalReadOperatorConfig) IsValid() bool {
	return l.FilePath != ""
}

type KafkaConsumeOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	Topics []string
}

type MysqlQueryOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	DelayTime time.Duration
}

type RabbitmqConsumeOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	Queue     string
	Consumer  string
	AutoAck   bool
	Exclusive bool
	NoLocal   bool
	NoWait    bool
	Args      amqp.Table
}

type RocketmqProduceOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	TimeOut time.Duration
}

type RocketmqConsumeOperatorConfig struct {
	*operator.BasicMultiChannelDataOperatorConfig
	Topic    string
	Selector *consumer.MessageSelector
}
